<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', 'HomeController@index');

Auth::routes();

/**
 * 验证
 */
Route::group(['namespace' => 'Auth'], function () {
    Route::get('forgot-password',function () {
        return view('auth.reset');
    })->name('forgot-password');
    Route::post('reset-password','ForgotPasswordController@resetPassword')->name('reset-password');
    Route::post('auth/send-sms-code-by-aliyun', 'AuthController@postSendSmsCodeByAliyun');
    Route::post('auth/update-password-send-sms-code-by-aliyun', 'AuthController@postUpdatePasswordSendSmsCodeByAliyun');
});
/**
 * 主页
 */
Route::get('/home', 'HomeController@index')->name('home');
Route::get('/cache-flush', 'HomeController@cacheFlush');
Route::get('/list/{name?}', 'HomeController@getList');            //列表
Route::get('/picture-list/{name?}', 'HomeController@getPictureList');            //列表
Route::get('/content/{content}', 'HomeController@getContent');          //文章
Route::get('/more-teacher', 'HomeController@teachers');


Route::group(['prefix'=>'live','namespace' => 'Live','middleware'=>['auth']],function (){
    Route::get('broadcast/{lesson}','LiveController@broadcast');
    Route::get('play/{lesson}','LiveController@play');
});
Route::group(['prefix'=>'evaluation','namespace' => 'Evaluation','middleware'=>['auth']],function (){
    Route::get('list','EvaluationController@index');
    Route::get('/{evaluation}/detail','EvaluationController@index');
});
Route::group(['prefix'=>'course','namespace' => 'Course','middleware'=>['auth']],function (){
    Route::get('/list','CourseController@index');
    Route::get('/{course}/course-detail','CourseController@detail');
    Route::get('user/{taskId}/task','TaskController@');
});
Route::group(['prefix'=>'user','namespace' => 'User','middleware'=>['auth']],function (){
    Route::get('user-center','UserController@index')->name('user-center');
});